﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using ElMexicanos.Base;
using Microsoft.Xna.Framework;
using ElMexicanos.Base.Models;
using ElMexicanos.Components.TowersTraps;


namespace ElMexicanos.Components.Screens.Game
{
    class TowerTrapScreen : GameScreen
    {
        Tower mytower;
        TowerManager towerManager;
        List<Mob> _all_mob;

        internal List<Mob> All_mob
        {
            get { return _all_mob; }
            set { _all_mob = value; }
        }

        ContentManager content;
        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;


        /// <summary>
        /// Constructor.
        /// </summary>
        public TowerTrapScreen()
        {
            towerManager = new TowerManager(All_mob);
        }

        /// <summary>
        /// Init the sprites
        /// </summary>
        public override void Initialize()
        {
            
            
        }


        /// <summary>
        /// Loads graphics content for this screen. The background texture is quite
        /// big, so we use our own local ContentManager to load it. This allows us
        /// to unload before going from the menus into the game itself, wheras if we
        /// used the shared ContentManager provided by the Game class, the content
        /// would remain loaded forever.
        /// </summary>
        public override void LoadContent()
        {
            //mytower.LoadContent();
            towerManager.LoadContent();
        }


        /// <summary>
        /// Unloads graphics content for this screen.
        /// </summary>
        public override void UnloadContent()
        {
            content.Unload();
        }



        /// <summary>
        /// Updates the background screen. Unlike most screens, this should not
        /// transition off even if it has been covered by another screen: it is
        /// supposed to be covered, after all! This overload forces the
        /// coveredByOtherScreen parameter to false in order to stop the base
        /// Update method wanting to transition off.
        /// </summary>
        public override void Update(GameTime gameTime, bool otherScreenHasFocus,
                                                       bool coveredByOtherScreen)
        {

            towerManager.Update(gameTime);

            base.Update(gameTime, otherScreenHasFocus, false);
        }


        /// <summary>
        /// Draws the background screen.
        /// </summary>
        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
            spriteBatch.Begin();

            towerManager.Draw(spriteBatch, gameTime);

            spriteBatch.End();
         
            base.Draw(gameTime);
        }



    }
}